package com.lechicanh.cgrid.ke.worker.servicelookup;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

import com.lechicanh.cgrid.ke.api.resource.ServiceName;
import com.lechicanh.cgrid.ke.api.service.HandlerService;

public class ServiceLookup {
	public static final HandlerService lookup(String path, int port) throws RemoteException, NotBoundException{
		Registry registry = LocateRegistry.getRegistry(path, port);
		return (HandlerService)registry.lookup(ServiceName.HANDLER_SERVICE);
	}
}
